package gui;

import java.awt.BasicStroke;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;

import javax.swing.JLabel;

/**
 * @author Ramy Refky 
 * */
public class WireGroupDisplay extends JLabel {
	
	private static final long serialVersionUID = 1L;
	
	int groupCount;
	/**
	 * Constructor initializes WireGroupDisplay Class, which is a diagonal dash and a number,
	 *  used to indicate wire grouping.
	 *  @param TopLeftX, TopLeftY, GroupCount
	 * */
	public WireGroupDisplay(int x,int y,int groupCount){
		this.groupCount=groupCount;
		setOpaque(false);
		setVisible(true);
		setBounds(x,y,30,30);
		JLabel label = new JLabel(groupCount+"");
		label.setBounds(5,-11,30,30);
		label.setVisible(true);
		this.add(label);
		
		repaint();	
	}
	
	public void paint(Graphics g) {
		super.paint(g);
		
		Graphics2D g2 = (Graphics2D)g;
    	g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                             RenderingHints.VALUE_ANTIALIAS_ON);
        g2.setStroke(new BasicStroke(2.5f));        
        g2.drawLine(18,10,10,28);
	}
}
